/**
 * Created by hu_it on 2016/11/10.
 */
require.config({
    baseUrl: "assets/js",
    urlArgs: "ver=v1.0013",
    paths: {
        "html5": "plugin/Html5/html5.min",
        "jquery": "plugin/Jquery/jquery-3.1.1.min",
        "bootstrap": "plugin/Bootstrap/js/bootstrap.min",
        "underscore": "plugin/Underscore/underscore-min",
        "backbone": "plugin/Backbone/backbone-min",
        "template": "plugin/Template/template-native",
        "fastclick": "plugin/Fastclick/fastclick",
        "layer_pc": "plugin/Layer_pc/layer",
        "layer_m": "plugin/Layer_m/layer",
        "amazeui": "plugin/Amazeui/js/amazeui.min",
        "ueditorcfg": "plugin/Ueditor/ueditor.config",
        "ueditor": "plugin/Ueditor/ueditor.all.min",
        //"ueditorzh": "plugin/Ueditor/lang/zh-cn/zh-cn",
        "swiper": "plugin/Swiper/swiper-3.4.0.min",
        "kkpager": "plugin/Kkpager/kkpager.min",
        "iscroll": "plugin/Iscroll/iscroll",
        "qrcode": "plugin/Qrcode/jquery.qrcode",
        "datetimepicker": "plugin/Datetimepicker/js/bootstrap-datetimepicker.min",
        "moment": "plugin/Moment/moment.min",
        "fly": "plugin/Fly/jquery.fly.min",
        "mock": "plugin/Mock/mock",
        "rainyday":"plugin/Rainyday/rainyday.min",
        "lockscreen": "plugin/Lockscreen/lockscreen",
        "route": "lib/route",
        "framework": "lib/framework",
        "templates": "lib/templates",
        "utils": "lib/utils",
        "main": "app/main",
        "getdata": "app/Getdata"
    },
    //map: {
    //    '*': {
    //        'css': 'css'
    //    }
    //},
    shim: {
        'bootstrap': {
            deps: ['jquery','css!plugin/Bootstrap/css/bootstrap.min.css']
        },
        underscore: {
            exports: '_'
        },
        'backbone':{
            deps:['underscore'],
            exports:'backbone'
        },
        'qrcode':{
            deps:['jquery'],
            exports:'qrcode'
        },
        'fly':{
            deps:['jquery'],
            exports:'fly'
        },
        'layer_m':{
            deps:['css!plugin/Layer_m/need/layer.css']
        },
        'layer_pc':{
            deps:['jquery','css!plugin/Layer_pc/skin/default/layer.css']
        },
        'amazeui':{
            deps:['jquery','css!plugin/Amazeui/css/amazeui.min.css']
        },
        'swiper':{
            deps:['css!plugin/Swiper/swiper-3.4.0.min.css']
        },
        'kkpager': {
            deps: ['jquery','css!plugin/Kkpager/kkpager_blue.css']
        }
    }
});

//require(['html5','jquery', 'bootstrap','underscore','backbone', 'template', 'fastclick' ,'layer_pc', 'amazeui','ueditorcfg','ueditor','swiper','kkpager','iscroll','qrcode','datetimepicker','moment','fly','lockscreen','utils','load'],
require(['html5','jquery','bootstrap','backbone','fastclick','route','rainyday','lockscreen','utils','main'],
    function (html5,$,bootstrap,Backbone,fastclick,Route) {
        $(function ()
        {
            var router = new Route();
            Backbone.history.start();
            fastclick.attach(document.body);

            var image = document.getElementById('background');
            image.crossOrigin = 'anonymous';
            image.src = 'assets/images/bg.jpg';

            image.onload = function() {
            var engine = new RainyDay({
                image: this
            });
            engine.rain([ [1, 2, 8000] ]);
            engine.rain([ [3, 3, 0.88], [5, 5, 0.9], [6, 2, 1] ], 100);
        };



    });
    });